package logic;

import data.UserTuple;

public class AlgoHandler {
	private Algorithm algo_;
	public AlgoHandler(Algorithm algo){
		algo_=algo;
	}
	public void setRecommendation(String userName, int begin) {
		UserTuple user=data.SystemData.getInstance().getUser(userName);
		if (Facade.getInstance().getNumRating(userName) <10){
			user.setDefaultRecs();
			user.setDateOfRecs();
		}else {
			user.setRecs(algo_.compute(user));
			user.setDateOfRecs();
		}
		ToGuiFacade.getInstance().showRecMovies(user.getRecs(begin),begin);
		
	}

}
